package com.zy.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zy.dao.AdminDao;
import com.zy.entity.Admin;
import com.zy.entity.Course;
import com.zy.entity.Paging;
import com.zy.entity.Speaker;
import com.zy.entity.Subject;
import com.zy.entity.Video;
import com.zy.entity.VideoEx;
import com.zy.mapper.AdminMapper;
@Component
public class AdminDaoImpl implements AdminDao{
	@Autowired
	private AdminMapper am;
	
	public AdminMapper getAm() {
		return am;
	}

	public void setAm(AdminMapper am) {
		this.am = am;
	}

	//查找所有用户
	@Override
	public List<Admin> getAllAdmin() {
		return am.getAllAdmin();
	}
	//查找所有视频

	@Override
	public List<Video> getAllVideo() {
		return am.getAllVideo();
	}
	//查询所有的教师
	@Override
	public List<Speaker> getAllSpeaker() {
		return am.getAllSpeaker();
	}
	//查询所有课程
	@Override
	public List<Course> getAllCourse() {
		return am.getAllCourse();
	}
	//添加视频
	@Override
	public void addVideo(Video vd) {
		am.addVideo(vd);
	}
	//批量删除
	@Override
	public void deleteBatcheVideo(int[] array) {
		am.deleteBatcheVideo(array);
	}
	//删除视频
	@Override
	public void deleteIdVideo(Video vd) {
		am.deleteIdVideo(vd);
	}
	//根据id查视频
	@Override
	public Video selectVideoById(Video vd) {
		return am.selectVideoById(vd);
	}
	//修改视频
	@Override
	public void updateVideo(Video vd) {
		am.updateVideo(vd);
	}
	//查询所有学科
	@Override
	public List<Subject> getAllSubject() {
		return am.getAllSubject();
	}
	//添加课程
	@Override
	public void addCourse(Course cu) {
		am.addCourse(cu);
	}
	//删除课程
	@Override
	public void deleteCourseById(Course cu) {
		am.deleteCourseById(cu);
	}
	//根据id查课程
	@Override
	public Course selectCourseById(Course cu) {
		return am.selectCourseById(cu);
	}
	//修改课程
	@Override
	public void updateCourse(Course cu) {
		am.updateCourse(cu);
	}
	//添加主讲人
	@Override
	public void addSpeaker(Speaker sp) {
		am.addSpeaker(sp);
	}
	//删除主讲人
	@Override
	public void deleteSpeakerById(Speaker sp) {
		am.deleteSpeakerById(sp);
	}
	//根据id查主讲人
	@Override
	public Speaker selectSpeakerById(Speaker sp) {
		return am.selectSpeakerById(sp);
	}
	//修改主讲人
	@Override
	public void updateSpeaker(Speaker sp) {
		am.updateSpeaker(sp);
	}
	//动态查询视频
	@Override
	public List<Video> selectLikeVideo(VideoEx vd) {
		return am.selectLikeVideo(vd);
	}
	//查询视频数量
	@Override
	public int countVideoById(Paging pg) {
		return am.countVideoById(pg);
	}
	//分页查询视频
	@Override
	public List<Video> selectLimitVideo(Paging pg) {
		return am.selectLimitVideo(pg);
	}
	
	

}
